<!--
 * @Author: your name
 * @Date: 2020-09-26 16:56:47
 * @LastEditTime: 2020-09-27 08:53:32
 * @LastEditors: your name
 * @Description: In User Settings Edit
 * @FilePath: \wallhaven\Application\Home\View\Public\west.html
-->
<div data-options="region:'west',title:'※ 欢迎您使用本系统 ※',split:true,hideCollapsedContent:false" style="width: 210px;">
    <div id="layout_west_accordion" class="easyui-accordion" data-options="fit:true,border:false">
    	<ul id="main_tree" class="easyui-tree"></ul>  



    </div>
</div>
<script>

    var tree_json = [{
        "id": 1,
        "text": "Wallhaven",
        "iconCls": "icon-standard-palette",
        "children": [{
            "id": 3,
            "text": "VIN码计算",
            "checked": true,
            "name": 'Home/Vin/cal',
            "iconCls": 'icon-standard-application-side-list'
        },
            {
                "id": 2,
                "text": "VIN码查询",
                "checked": true,
                "name": 'Home/Vin/index',
                "iconCls": 'icon-standard-application-side-list'
            }]
    }];

  $('#main_tree').tree({
  	data:tree_json,
	onClick: function(node){
		addTab(node)  // 在用户点击的时候提示
	}
});







  
function addTab(node){

if(node.id!=1){
	    if ($('#main_tab').tabs('exists', node.text)){
                    $('#main_tab').tabs('select', node.text);    
                } else {
    $('#main_tab').tabs('add',{ 
    title:node.text, 
    iconCls:node.iconCls,  
    fit:true,
    href:'__APP__/'+node.name,
    loadingMessage:node.text+'正在载进中…',
    closable:true  
});
    }

}




}


</script>


	
